import {HttpClient} from '@angular/common/http';
import {Apiresponse} from './apiresponse';
import {Observable} from 'rxjs';
import {Injectable} from '@angular/core';

/*标识可被注入*/
@Injectable()
export class ApiService {

  /*ApiService 已经导出一个类*/
  /*private 表示AboutComponent属性*/
  constructor(private http: HttpClient) {

  }

  /*返回结果 rxjs简单异步库*/
  public CallApi(): Observable<Apiresponse> {
    /*相当于get方法*/
    return this.http.get<Apiresponse>("https://kahla.server.aiursoft.com/debugapi");
  }

}
